package com.demo.security.properties;

import com.demo.security.token.Token;

/**
 *
 * jwt 相关配置参数
 *
 * @author molong
 * @since 2024/5/23
 */
public class JwtProperties {

    /**
     * {@link Token} 5分钟
     */
    private Long tokenExpirationTime = 300L;

    /**
     * iss: 该JWT的签发者
     */
    private String tokenIssuer = "demo";

    /**
     * 用于签名token {@link Token}.
     * 默认值:  BASE64.encode(MD5("demo"))
     * token加密
     */
    private String tokenSigningKey = "RkUwMUNFMkE3RkJBQzhGQUZBRUQ3Qzk4MkEwNEUyMjkKIA==";

    /**
     * TOKEN刷新TOKEN,访问token根据此token可以在过期时刷新一个新token.而不是重新认证
     * 默认一小时过期
     */
    private Long refreshTokenExpTime = tokenExpirationTime * 12;

    /**
     * 当使用统一认证进行登陆时,TOKEN也需要在统一认证进行验证,
     * URL设置远程验证接口,URL参数需要在配置文件中自行配置
     * 实际请求发送中,将替换具体的TOKEN
     */
    private String unifiedAuthUrl;


    public Long getRefreshTokenExpTime() {
        return refreshTokenExpTime;
    }

    public void setRefreshTokenExpTime(Long refreshTokenExpTime) {
        this.refreshTokenExpTime = refreshTokenExpTime;
    }

    public Long getTokenExpirationTime() {
        return tokenExpirationTime;
    }

    public void setTokenExpirationTime(Long tokenExpirationTime) {
        this.tokenExpirationTime = tokenExpirationTime;
    }

    public String getTokenIssuer() {
        return tokenIssuer;
    }

    public void setTokenIssuer(String tokenIssuer) {
        this.tokenIssuer = tokenIssuer;
    }

    public String getTokenSigningKey() {
        return tokenSigningKey;
    }

    public void setTokenSigningKey(String tokenSigningKey) {
        this.tokenSigningKey = tokenSigningKey;
    }


    public String getUnifiedAuthUrl() {
        return unifiedAuthUrl;
    }

    public void setUnifiedAuthUrl(String unifiedAuthUrl) {
        this.unifiedAuthUrl = unifiedAuthUrl;
    }

}

